package com.hx.controller;

import com.hx.poji.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@RestController   //当一个类中同时出现了@responseBody 和@Controller的时候
                    // 可以使用RestController  来替换
public class Controller04 {

    /**
     * jackson
     * @param id
     * @return
     */

    @RequestMapping("/test10")
    public User test10(Integer id) {
        User user = new User(66,"用户"+id,"男","666");
        return user;
    }


    @RequestMapping("/test11")
    public List<User> test11() {
        User user1 = new User(66,"用户6","男","666");
        User user2 = new User(88,"用户8","女","888");
         List list = new ArrayList();
         list.add(user1);
         list.add(user2);
        return list;
    }





}
